#ifndef _OBJECT_H_
#define _OBJECT_H_

#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/highgui/highgui.hpp> // OpenCV window I/O>
#include <opencv2/imgproc/imgproc.hpp>  // cvtColor()
#include <iostream>

using namespace cv;
using namespace std;

class Object{
private:
	//current position
	Point centroid;
	Point topLeft;
	Point downRight;
	int width;
	int height;
	int vX;
	int vY;

	//predict position
	Point centroidPredict;
	//measure position
	Point centroidMeasure;
	//correct position
	//Point centroidCorrect;
public:
	Object();
	Object(Point topLeft, Point downRight);
	Object(unsigned int minx, unsigned int miny, unsigned int maxx, unsigned int maxy);
	~Object();
	void predict(Object* allObject, int numObject);
	void measure(Mat preFrame, Mat frame, Object* allObject, int numObject);
	void correct(Mat preFrame, Mat frame, int numObject);
	Point getTopLeft();
	Point getDownRight();
	Point getCentroid();
	Point getCentroidPredict();
	Point getCentroidMeasure();
private:
	float correlation(const Mat &roiObject, const Mat &roiCandidateObject);
	void reMatching( Mat templateImg, Mat roiImage, Point &result );
	float compareHistogram( Mat src_base, Mat src_test1 );
};
#endif